package utility;

import java.io.Serializable;
import java.util.List;
import org.jgrapht.Graph;
import org.jgrapht.GraphPath;

public class MyGraphPathImpl<V,E> implements GraphPath<V, E>, Serializable{

	private static final long serialVersionUID = 1L;

	private Graph<V,E> graph;
	private V startVertex;
	private V endVertex;
	private List<E> edgeList;
	private double weight;
	
	public MyGraphPathImpl(Graph<V,E> graph,
            V startVertex,
            V endVertex,
            List<E> edgeList,
            double weight) {
		this.graph = graph;
		this.startVertex = startVertex;
		this.endVertex = endVertex;
		this.edgeList = edgeList;
		this.weight = weight;
		
	}
	
	@Override
	public List<E> getEdgeList() {
		// TODO Auto-generated method stub
		return edgeList;
	}

	@Override
	public V getEndVertex() {
		// TODO Auto-generated method stub
		return endVertex;
	}

	@Override
	public Graph<V, E> getGraph() {
		// TODO Auto-generated method stub
		return graph;
	}

	@Override
	public V getStartVertex() {
		// TODO Auto-generated method stub
		return startVertex;
	}

	@Override
	public double getWeight() {
		// TODO Auto-generated method stub
		return weight;
	}

	@Override
	public String toString() {
		return "MyGraphPathImpl [graph=" + graph + ", startVertex="
				+ startVertex + ", endVertex=" + endVertex + ", edgeList="
				+ edgeList + ", weight=" + weight + "]";
	}
	
	public V getEdgedSource(E arch) {
		return graph.getEdgeSource(arch);
	}
	
	public V getEdgedTarget(E arch) {		
		return graph.getEdgeTarget(arch);
	}
	
}
